#include <iostream>
using std::cout;
using std::endl;

class Point
{
public:
    Point(int x ,int y)
    : _ix(x)
    , _iy(y)
    {
        cout << "Point(int,int)" << endl;
    }

    Point(const Point & rhs)
    : _ix(rhs._ix)
    , _iy(rhs._iy)
    {
        cout << "Point(const Point &)" << endl;
    }
    

    //const Point * const this
    void print() const{
        cout << "const版本的print" << endl;
        /* _ix = 100; */
        cout << "(" << _ix
            << "," << _iy
            << ")" << endl;
    }

    /* //Point * const this */
    /* void print() { */
    /*     cout << "非const版本的print" << endl; */
    /*     _ix = 100; */
    /*     cout << "(" << _ix */
    /*         << "," << _iy */
    /*         << ")" << endl; */
    /* } */


    void setX(){
        _ix = 1000;
    }

    ~Point(){
        cout << "~Point()" << endl;
    }
private:
    int _ix;
    int _iy;
};

void test0(){
    Point p1(1,8);
    /* p1.setX(); */
    p1.print();

    /* const int x = 10; */
    /* x = 100; */
    const Point p2(3,4);
    /* p2.setX(); */
    p2.print();
}

int main(void){
    test0();
    return 0;
}
